<div class="contents">
  <ol class="breadcrumb">
    <li><a href="#/index/panel">首页</a></li>
    <li><a href="#/neworder/caiwu/ordermanager/incomplete/list?m=05" >未完成的订单列表</a>
    </li>
    <li class="active">{{item.oPName}}</li>
    <li class="active">订单详情</li>
  </ol> 
  
  <form class="form-horizontal" role="form" name="form" ng-submit="save()" novalidate>
  <table class="table table-striped table-bordered">
    <tbody> 
      <tr>
        <td width="140">订单ID</td> <td width="400">{{item.id}}</td>
        <td width="140">订单号</td> <td width="400">{{item.oCode}}</td>
       </tr>
     
      <tr>
        <td >订单金额</td> <td >{{item.oAmount | moneyRender2}}</td> 
        <td>当前状态</td> <td class="order-status-{{item.oStatus}}" >{{item.oStatus | orderStatusRender}}</td> 
      </tr>
      <tr>
        <td >产品简称</td>
        <td  ng-if="item.oPType == '06'">
          <a href="https://www.superfa.cn/product/pevc/view/{{item.oProjectCode}}" target="_blank">{{item.oPName}}</a>
        </td>
        <td ng-if="item.oPType != '06'">
          <a href="http://www.superfa.cn/product/{{item.oProjectCode}}" target="_blank">{{item.oPName}}</a>
        </td>
        <td>理财师FAID</td><td >{{item.oFAId}}</td>
      </tr>
      <tr>
         <td>客户姓名</td> <td >{{item.oCName}}</td>
         <td>预约时间</td> <td >{{item.createDate | date:'yyyy-MM-dd HH:mm'}}</td>
      </tr>
      <tr>
        <td>预约成功时间</td> <td >{{item.yuYueChengGongDate | date:'yyyy-MM-dd HH:mm'}}</td> 
        <td>操作人</td> <td >{{item.yuYueChengGongBy}}</td> 
      </tr>
      <tr>
        <td>合同寄出时间</td> <td >{{item.heTongJiChuDate | date:'yyyy-MM-dd HH:mm'}}</td> 
        <td>操作人</td> <td >{{item.heTongJiChuBy}}</td> 
      </tr>
      <tr>
        <td>签约打款时间</td> <td >{{item.qianYueDaKuanDate | date:'yyyy-MM-dd HH:mm'}}</td> 
        <td>操作人</td> <td >{{item.qianYueDaKuanBy}}</td> 
      </tr>
      <tr>
        <td>确认到款时间</td> <td >{{item.queRenDaKuanDate | date:'yyyy-MM-dd HH:mm'}}</td> 
        <td>操作人</td> <td >{{item.queRenDaKuanBy}}</td> 
      </tr>
      <tr>
        <td>佣金到账时间</td> <td >{{item.yongJinDaoZhangDate | date:'yyyy-MM-dd HH:mm'}}</td> 
        <td>操作人</td> <td >{{item.yongJinDaoZhangBy}}</td> 
      </tr>
      <tr>
        <td>财务结佣时间</td> <td >{{item.caiWuJieYongDate | date:'yyyy-MM-dd HH:mm'}}</td> 
        <td>操作人</td> <td >{{item.caiWuJieYongBy}}</td> 
      </tr>
      <tr>
        <td>确认返佣时间</td> <td >{{item.queRenFanYongDate | date:'yyyy-MM-dd HH:mm'}}</td> 
        <td>操作人</td> <td >{{item.queRenFanYongBy}}</td> 
      </tr>
      <tr>
        <td>确认提交有效合同</td> <td >{{item.queRenHeTongDate | date:'yyyy-MM-dd HH:mm'}}</td> 
        <td>操作人</td> <td >{{item.queRenHeTongBy}}</td> 
      </tr>
      <tr>
        <td>后端佣金到账时间</td> <td >{{item.houDuanYongJinDaoZhangDate | date:'yyyy-MM-dd HH:mm'}}</td> 
        <td>操作人</td> <td >{{item.houDuanYongJinDaoZhangBy}}</td> 
      </tr>
      <tr>
        <td>后端财务结佣时间</td> <td >{{item.houDuanCaiWuJieYongDate | date:'yyyy-MM-dd HH:mm'}}</td> 
        <td>操作人</td> <td >{{item.houDuanCaiWuJieYongBy}}</td> 
      </tr>
      <tr>
        <td>后端确认返佣时间</td> <td >{{item.houDuanQueRenFanYongDate | date:'yyyy-MM-dd HH:mm'}}</td> 
        <td>操作人</td> <td >{{item.houDuanQueRenFanYongBy}}</td> 
      </tr>
      
      <tr>
        <td>结束交易时间</td> <td >{{item.jieShuJiaoYiDate | date:'yyyy-MM-dd HH:mm'}}</td> 
        <td>操作人</td> <td >{{item.jieShuJiaoYiBy}}</td> 
      </tr>

      <tr>
        <td>机构价</td> <td >{{item.oSellingPrice | profitRender}}</td> 
        <td>后端机构价</td> <td >{{item.oBackSellingPrice| profitRender}}</td> 
      </tr>
      <tr>
        <td>渠道核心返佣额</td> <td >{{item.oSellingRebate | moneyRender2:1:1}}</td> 
        <td>后端渠道核心返佣额</td> <td >{{item.oBackSellingRebate | moneyRender2:1:1}}</td> 
      </tr>
      <tr>
        <td>挂网价</td> <td >{{item.oRebateRate | profitRender}}</td> 
        <td>后端挂网价</td> <td >{{item.oBackRebateRate| profitRender}}</td> 
      </tr>
      <tr>
        <td>挂网返佣额</td> <td >{{item.oRebateAmount | moneyRender2:1:1}} </td> 
        <td>后端挂网返佣额</td> <td >{{item.oBackRebateAmount | moneyRender2:1:1}}</td> 
      </tr>
      <tr >
        <td>成交价</td>
        <td ng-if="item.shiZhuFlag == '0'"> 
            <input type="number" class="form-control" ng-class="{'new-error-css':form.oTransactionPrice.$invalid}" placeholder="成交价(不带百分号)" name="oTransactionPrice" ng-model="item.oTransactionPrice"  required="required" only-num ng-pattern="/^\d{1,}\.?\d{0,2}$/">
         </td>
         <td ng-if="item.shiZhuFlag == '1'">{{item.oTransactionPrice | profitRender}}</td>
        <td>后端成交价</td> <td >{{item.oBackTransactionPrice | profitRender}}</td> 
      </tr>
      <tr>
          <td>成交返佣额</td> 
          <td ng-if="item.shiZhuFlag == '0'">{{(item.oTransactionPrice * item.oAmount / 100) | moneyRender2:1:1}}</td>
          <td ng-if="item.shiZhuFlag == '1'">{{item.oTransactionRebate | moneyRender2:1:1}}</td>
          <td>后端成交返佣额</td> 
          <td >{{item.oBackTransactionRebate | moneyRender2:1:1}}</td> 
      </tr>

     <tr>
        <td>打款人</td> <td >{{item.upstreamHitman}}</td> 
        <td>打款账号</td> <td >{{item.upstreamHitmanNum}}</td> 
      </tr>

     <tr>
        <td>收款人</td> <td >{{item.oFARealName}}</td> 
        <td>收款账号</td> <td >{{item.oFACardNum}}</td> 
      </tr>

      <tr>
        <td>寄出合同编号</td> <td >{{item.sendContractNum}}</td> 
        <td>收回合同编号</td> <td >{{item.receiveContractNum}}</td> 
      </tr>

      <tr>
        <td>结佣额(上游/单位：元)</td> <td >{{item.confirmForntAmount | moneyRender2:1:1}}</td> 
        <td>后端结佣额(上游/单位：元)</td> <td >{{item.confirmBackAmount | moneyRender2:1:1}}</td> 
      </tr>

      <tr>
        <td>其他结款额(上游/单位：元)</td> <td >{{item.confirmOtherAmount | moneyRender2:1:1}}</td> 
        <td>其他结款说明(上游)</td> <td >{{item.comfirmOtherSectionDesc}}</td> 
      </tr>
      
      <tr>
        <td >财务前端结佣(单位：元)</td> 
        <td ng-if="item.oStatus == '310' && item.shiZhuFlag != '0'">

        <input type="number" class="form-control" placeholder="财务前端结佣" ng-class="{'new-error-css':form.oFinanceFrontRebate.$invalid}" name="oFinanceFrontRebate" ng-model="item.oFinanceFrontRebate" required="required" only-num ng-pattern="/^\d{1,}\.?\d{0,2}$/"></td> 
        <td ng-if="item.oStatus != '310' || item.shiZhuFlag == '0'">{{item.oFinanceFrontRebate | moneyRender2:1:1}}</td> 

        <td>财务后端结佣(单位：元)</td>
        <td >{{item.oFinanceBackRebate | moneyRender2:1:1}}</td> 
      </tr>
      <tr>
        <td>活动打款(财务/单位：元)</td> 
        <td  ng-if="item.oStatus == '310' && item.shiZhuFlag != '0'">
           <input type="number" class="form-control" ng-class="{'new-error-css':form.oActivityAmount.$invalid}" name="oActivityAmount" placeholder="活动打款"  ng-model="item.oActivityAmount" required="required" only-num ng-pattern="/^\d{1,}\.?\d{0,2}$/">
        </td> 
        <td ng-if="item.oStatus != '310' || item.shiZhuFlag == '0'">
           {{item.oActivityAmount | moneyRender2:1:1}}
        </td>
        <td>活动打款说明(财务)</td>
         <td ng-if="item.oStatus == '310' && item.shiZhuFlag != '0'">
          <input type="text" class="form-control" ng-class="{'new-error-css':form.oPlaySectionDesc.$invalid}" name="oPlaySectionDesc" placeholder="活动打款说明" ng-model="item.oPlaySectionDesc"  required="required" ></td> 
          <td ng-if="item.oStatus != '310' || item.shiZhuFlag == '0'">
           {{item.oPlaySectionDesc}}
         </td>
      </tr>
      <tr>
        <td>其他打款额(财务/单位：元)</td> 
        <td  ng-if="item.oStatus == '310' && item.shiZhuFlag != '0'">
           <input type="number" class="form-control" ng-class="{'new-error-css':form.oFinanceOtherAmount.$invalid}" name="oFinanceOtherAmount" placeholder="其他打款额"  ng-model="item.oFinanceOtherAmount" required="required" only-num ng-pattern="/^\d{1,}\.?\d{0,2}$/">
        </td> 
        <td ng-if="item.oStatus != '310' || item.shiZhuFlag == '0'">
           {{item.oFinanceOtherAmount | moneyRender2:1:1}}
        </td>
        <td>其他打款说明(财务)</td>
         <td ng-if="item.oStatus == '310' && item.shiZhuFlag != '0'">
          <input type="text" class="form-control" ng-class="{'new-error-css':form.oFinancOtherAmountDesc.$invalid}" name="oFinancOtherAmountDesc" placeholder="其他打款说明" ng-model="item.oFinancOtherAmountDesc"  required="required" ></td> 
          <td ng-if="item.oStatus != '310' || item.shiZhuFlag == '0'">
           {{item.oFinancOtherAmountDesc}}
         </td>
      </tr>
      <tr>
        <td>前端结佣方式</td>
        <td>{{item.oRebateType | oRebateTypeRender}}{{item.oYouDanRebateType | oRebateTypeRender}}</td>
        <td>后端结佣方式</td>
        <td>{{item.oBackRebateType | oRebateTypeRender}}</td>
      </tr>
      <tr>
        <td>前端线下打款银行</td>
        <td ng-if="item.oStatus == '310' && item.shiZhuFlag != '0'"><input type="text" class="form-control" ng-class="{'new-error-css':form.oRebateBankId.$invalid}" ng-model="item.oRebateBankId" placeholder="打款银行（如果线下结佣请填写）" name="oRebateBankId" ng-required="isReq"></td>
        <td ng-if="item.oStatus != '310' || item.shiZhuFlag == '0'">{{item.oRebateBankId}}</td>
        <td>后端线下打款银行</td>
        <td>{{item.oBackRebateBankId}}</td>
      </tr>
      <tr>
        <td>前端线下打款姓名</td>
        <td ng-if="item.oStatus == '310' && item.shiZhuFlag != '0'"><input type="text" class="form-control" placeholder="前端线下打款姓名（如果线下结佣请填写）" ng-class="{'new-error-css':form.oRebateBankCardHolder.$invalid}" name="oRebateBankCardHolder"  ng-model="item.oRebateBankCardHolder" ng-required="isReq"></td>
        <td ng-if="item.oStatus != '310' || item.shiZhuFlag == '0'">{{item.oRebateBankCardHolder}}</td>
        <td>后端线下打款姓名</td>
        <td>{{item.oBackRebateBankCardHolder}}</td>
      </tr>
      <tr>
        <td>前端线下打款银行号</td>
        <td ng-if="item.oStatus == '310' && item.shiZhuFlag != '0'"><input type="text" class="form-control" placeholder="前端线下打款银行号（如果线下结佣请填写" ng-class="{'new-error-css':form.oRebateBankCardNumber.$invalid}" name="oRebateBankCardNumber"  ng-model="item.oRebateBankCardNumber" only-num ng-pattern="/^[0-9]*$/" ng-required="isReq"></td>
        <td ng-if="item.oStatus != '310' || item.shiZhuFlag == '0'">{{item.oRebateBankCardNumber}}</td>
        <td>后端线下打款银行号</td>
        <td>{{item.oBackRebateBankCardNumber}}</td>
      </tr>
      <tr ng-if="item.oYouDanRebateType == 1">
        <td>用户自提状态</td>
        <td>{{item.oYouDanOperateType | operateTypeModelRenter}}</td>
        <td></td>
        <td></td>
      </tr>

      <tr ng-if="item.oRebateType == 1 || item.oBackRebateType == 1">
        <td><span ng-if="item.oRebateType == 1">前端用户自提状态</span></td>
        <td><span ng-if="item.oRebateType == 1">{{item.oRebateOperateType | operateTypeModelRenter}}</span></td>
        <td><span ng-if="item.oBackRebateType == 1">后端用户自提状态</span></td>
        <td><span ng-if="item.oBackRebateType == 1">{{item.oBackRebateOperateType | operateTypeModelRenter}}</span></td>
      </tr>
     <!-- <tr>
        <td ng-if="item.oStatus == '310' && item.shiZhuFlag != '0'"><div class="btn btn-primary add-pic-btn">上传打款凭条</div></td>
        <td ng-if="item.oStatus != '310' || item.shiZhuFlag == '0'"><div class="btn btn-primary add-pic-btn" disabled="disabled">上传打款凭条</div></td>
        <td ng-if="item.oStatus == '310' && item.shiZhuFlag != '0'">
            <input type="text" class="form-control" ng-class="{'new-error-css':form.oContractDocument.$invalid}" name="oContractDocument" placeholder="上传打款凭条" id="advertLinkInput"  ng-model="item.oContractDocument" readonly="true" required="required" >
        </td>
        <td ng-if="item.oStatus != '310' || item.shiZhuFlag == '0'">
            <input type="text" class="form-control"  name="oContractDocument" placeholder="上传打款凭条" id="advertLinkInput"  ng-model="item.oContractDocument" readonly="true"  >
        </td>

        <td ><div  class="btn btn-primary"  disabled="disabled" placeholder="image.png" >上传打款凭条(后端)</div></td>
        <td >
            <input type="text" class="form-control"  placeholder="上传打款凭条(后端)" id="advertLinkInput" ng-model="item.oBackContractDocument" readonly="true"  >
        </td>
      </tr>-->

      <tr>
        <td>结款类型</td> 
        <td ng-if="item.oStatus == '110'">
        <select class="form-control" placeholder="订单状态" name="" ng-model="selectedId"  ng-options="m.value as m.text for m in dictMap.knotTypeModel" ><option value="">--结款类型--</option></select> 
        </td> 
        <td ng-if="item.oStatus!= '110'">
           {{item.oKnotType | oKnotTypeRender}}
        </td>
        
        <td>订单备注</td> <td >{{item.oRemark}}</td> 
      </tr>
      <tr>
        <td>订单是否有效</td> 
        <td class="order-defriend-status-{{item.oDefriendStatus}}" colspan="3">{{item.oDefriendStatus | orderDefriendStatusRender}}(百万冲十亿活动状态)</td> 
        
      </tr>
      

      <tr>
        <td>相关操作</td>
        <td colspan="3">
          <div  class="btn btn-primary" disabled="disabled" ng-if="item.oStatus == '320'">等待返佣确认</div>
          <div  class="btn btn-primary" disabled="disabled" ng-if="item.oStatus == '210'">等待打款</div>
          <div  class="btn btn-primary" ng-click="applySuccess()" ng-if="item.oStatus == '110'">预约成功</div>

          <div  class="btn btn-primary "  ng-click="applyFail()" ng-if="item.oStatus == '110'">预约失败</div>

          <div  class="btn btn-red"   ng-click="showVisitLayer()" ng-if="item.oStatus < '310' && item.oStatus != '140'">订单失败</div>

          <div  class="btn btn-primary" ng-click="sendContract()" ng-if="item.oStatus == '130'">寄出合同</div>

          <div  class="btn btn-warning" ng-click="process(220)" ng-if="item.oStatus == '210'" ng-confirm-click="请确认已得到理财师的同意,并代之操作'已签约打款'?">已签约打款</div>

          <div  class="btn btn-primary" ng-click="comfirmPay()" ng-if="item.oStatus == '220'">确认到款</div>

          <div  class="btn btn-primary" ng-click="frontRabite()" ng-if="item.oStatus == '240'">佣金到账</div>
         
          <div  class="btn btn-primary" ng-click="frontFinance(2)" ng-if="item.oStatus == '310' && item.shiZhuFlag != '0'">财务确认线下结佣</div>
       <!--   <div  class="btn btn-primary" ng-click="frontFinance(1)" ng-if="item.oStatus == '310' && item.shiZhuFlag != '0'">用户自提</div> 
       -->

          <div  class="btn btn-primary" ng-click="querenCJJ()" ng-if="item.shiZhuFlag == '0'">确认</div>

          <div  class="btn btn-primary" disabled="disabled" ng-click="comfirmFrontRabite()" ng-if="item.oStatus == '320'&& item.shiZhuFlag != '0'">确认返佣</div>
          
          <div  class="btn btn-primary" disabled="disabled" ng-click="takeEffectiveContract()" ng-if="item.oStatus == '330'">提交有效合同</div>
        
        </td>
    </tr>
    </tbody>
  </table> 
  </form>
<div class="layer-box" ng-show="isShowVisitLayer">
  <div class="layer-bg"></div>
  <div class="layer-con " style="padding:10px 20px; width:450px; left:40%">
    <span class="icons-close" title="关闭" ng-click="isShowVisitLayer = false;">X</span>
    <div class="layer-title">
      FAID:{{item.oFAId}}
    </div>
    <div class="con-wrap">
      <div class="form-group" >

        <table class="table table-striped table-bordered">
          <tr>
            <td width="120px">操作人</td>
            <td width="120px">操作时间</td>
            <td width="190px">失败原因</td>
          </tr>

          <tr ng-if="item.oStatus=='888'">
            <td>{{item.updateBy}}</td>
            <td>{{item.updateDate}}</td>
            <td>{{item.oCancelReason}}</td>
          </tr>
        </table>


        <table class="table table-striped table-bordered">
          
          <tr>
            <td><input type="text" class="form-control" placeholder="订单失败原因" ng-model="oCancelReason" required="required" /></td>
            <td>
              <input type="button" value="确认失败"  class="btn btn-small btn-warning" ng-click="confirmFailure()" />
            </td>
          </tr>
        </table>
      </div>
    </div>
  </div>
</div> 

</div>
<div load-script src="'/static/jquery.jUploader-1.01.js?5'" call-back="" charset="utf-8" ></div>
